<template>
    <section id="withdrawRecords">
      <div class="content">
          <div class="title">
              <div>时间</div>
              <div>订单</div>
              <div>类型</div>
              <div>金额 ($)</div>
              <div>状态</div>
          </div>
          <div class="lists">
            <div class="list" v-for="(item,index) in lists.data" :key="index" v-if="lists.total > 0">
              <div>{{item.create_time | timeToDate}}</div>
              <div>{{item.order_id}}</div>
              <div>提现</div>
              <div>{{item.money}}</div>
              <div>{{item.status == 1 && '待审核' || item.status == 2 && '成功' || item.status == 3 && '审核失败'}}</div>
            </div>
            <div v-if="lists.total === 0">
              <base-nodata></base-nodata>
            </div>
          </div>
      </div>
      <Page :total="lists.pages*10" @on-change="pageChange" v-if="lists.pages > 0" class-name="pageUserStyle" />
    </section>
</template>
<script>
import {_getWithdrawRecords} from '../../axios/index.js';
export default {
  data() {
    return {
      lists:'',
      params:{
        page:1,
        pageNum:10
      }
    }
  },
  methods:{
    async getWithdrawRecords() {
      const res = await _getWithdrawRecords(this.params.page,this.params.pageNum);
      if (res.data.code === 200) {
        this.lists = res.data.data;
      }
    },
    pageChange(value){
      this.params.page=value;
      this.getWithdrawRecords();
    },
  },
  created() {
    this.$emit('title','提现记录');
    this.getWithdrawRecords();
  }
}
</script>
